import type { IPageData } from "~/types/common";
import type { IAuthor, IUserAuthor } from "~/types/manage/content/author";
import { request } from "~/utils/http";

export const apiAddUserAuthor = (data: Partial<IUserAuthor>) =>
  request.post("/authors", data);

export const apiUserAuthorList = (params: {
  pageNum: number;
  pageSize: number;
  penName?: string;
}): Promise<IPageData<IUserAuthor>> => request.get("/authors/list", { params });

export const apiUserAuthorAll = (): Promise<IAuthor[]> =>
  request.get("/authors/all");
